using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EuropeEngulfed.NET
{
    partial class CountrySelectionDialog : Form
    {
        private MapInfo.CountryID selectedCountry = MapInfo.CountryID.BalticStates;

        public MapInfo.CountryID SelectedCountry
        {
            get
            {
                return selectedCountry;
            }
        }

        public CountrySelectionDialog(List<MapInfo.CountryID> listOfCountries)
        {
            InitializeComponent();
            foreach (MapInfo.CountryID country in listOfCountries)
            {
                this.countriesComboBox.Items.Add(country.ToString());
            }
            this.countriesComboBox.SelectedItem = this.countriesComboBox.Items[0];
        }

        private void countriesComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            selectedCountry = (MapInfo.CountryID)Enum.Parse(typeof(MapInfo.CountryID), this.countriesComboBox.SelectedItem.ToString());
        }

        private void OkButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}